<%@page import="key.Info"%>
<%@page import="key.Log" %>
<%@page import="key.Database" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
Database db = new Database();
List<Info> timeList = db.createList(null, null);
%>
<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    <title>设置不可用</title>
	<link rel="stylesheet" href="css/pci.css">
	<script type="text/javascript" src="js/inf.js"></script>
  </head>
   <body>

   <script type="text/javascript">
        function selectAll(){
var a = document.getElementsByTagName("input");
if(a[0].checked){
for(var i = 0;i<a.length;i++){
if(a[i].type == "checkbox") a[i].checked = false;
}
}
else{
for(var i = 0;i<a.length;i++){
if(a[i].type == "checkbox") a[i].checked = true;
}
}
}
    </script>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <a class="navbar-brand">Welcome 管理员</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="master/index.jsp">返回</a></li>
            <li><a style="cursor:pointer;" onClick="selectAll()">全选</a></li>
            <li><a style="cursor:pointer;" onClick="check();">提交</a></li>
          </ul>
        </div>
      </div>
    </nav>

<form action="Mdisable" method="post" id="cb">
    <div class="container-fluid">
      <div class="row">
          <h1>Set As Disable</h1>
          <div class="table-responsive">
            <table class="table table-striped">
              <thead>
                <tr>
                  <th>Time</th>
                  <th>MON.</th>
                  <th>TUE.</th>
                  <th>WED.</th>
                  <th>THU.</th>
                  <th>FRI.</th>
                  <th>SAT.</th>
                  <th>SUN.</th>
                </tr>
              </thead>
              <tbody>
                <tr>
                  <td class="time">8 - 9</td>
<%
for(int id = 108; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">9 - 10</td>
<%
for(int id = 109; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">10 - 11</td>
<%
for(int id = 110; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">11 - 12</td>
<%
for(int id = 111; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">12 - 13</td>
<%
for(int id = 112; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">13 - 14</td>
<%
for(int id = 113; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">14 - 15</td>
<%
for(int id = 114; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">15 - 16</td>
<%
for(int id = 115; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">16 - 17</td>
<%
for(int id = 116; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">17 - 18</td>
<%
for(int id = 117; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">18 - 19</td>
<%
for(int id = 118; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
            	</tr>
                <tr>
                  <td class="time">19 - 20</td>
<%
for(int id = 119; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
                <tr>
                  <td class="time">20 - 21</td>
<%
for(int id = 120; id < 800; id += 100){//生成动态信息表格
	for(Info info:timeList){
    	int flag = Integer.parseInt(info.getTid());
        if(flag == id){//找到
        	String display = info.getUname(); 
            if(display.equals("Disable")) {
			%>
								<td class="disable">Disable</td>
			<%
			} else if(display.equals("Empty")) {
			%>
								<td><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>">Empty</label></td>
			<%
			} else {
			%>
								<td class="others"><input class="chk_1" type="checkbox" id="<%=id%>" value="<%=id%>" name="adt" /><label for="<%=id%>"><%=display %></label></td>
			<%
         	}
     	}
     }
}
            %>
                </tr>
              </tbody>
            </table>
          </div>
      </div>
    </div>
    </form>
  </body>
</html>
